package com.fate.securecheckplatform.base;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.fate.securecheckplatform.SecureCheckApplication;
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;

import org.greenrobot.eventbus.EventBus;

import butterknife.ButterKnife;
import butterknife.Unbinder;

public abstract class BaseActivity extends RxAppCompatActivity {

    private Unbinder binder;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(layoutResId());
        SecureCheckApplication.get().addActivity(this);
        binder = ButterKnife.bind(this);
        initView();
        initData();
    }

    protected abstract int layoutResId();

    protected abstract void initData();

    protected abstract void initView();


    @Override
    protected void onDestroy() {
        binder.unbind();
        super.onDestroy();

    }
}
